import { handleActions as createReducer } from "redux-actions"
import { add, deletes } from '../actions/conter.actions';

const initialState = {
    count: 0
}

const handleAdd = (state) => {
    return {
        ...state,
        count: state.count + 1
    }
}


const handleDeletes = (state) => {
    return {
        ...state,
        count: state.count - 1
    }
}

export default createReducer({
    [add]: handleAdd,
    [deletes]: handleDeletes,

}, initialState)